using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DTO;
namespace DAO
{
    public class SanBayDAO
    {
        public static bool HienThiTenSanBay(List<DTO.SanBay> tensb)
        {
            string sql = "Select * from SanBay";
            DataTable dt= Config.AccessHelper.ExecuteQuery(sql);
            if (dt != null)
            {
                for(int i= 0; i< dt.Rows.Count;i++)
                {
                    DTO.SanBay sb = new DTO.SanBay();
                    sb.MaSanBay = int.Parse(dt.Rows[i].ItemArray[0].ToString());
                    sb.TenSanBay = dt.Rows[i].ItemArray[1].ToString();
                    tensb.Add(sb);
                }
                return true;
            }
            return false;
        }
    }
}
